package org.devgframwork.web.config;

import org.devgframwork.platform.support.filters.RequestWebFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.Arrays;


/**
 * @author duheng
 * @Date 2021/11/13 17:09
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Bean
    public FilterRegistrationBean<RequestWebFilter> myFilterFilterRegistrationBean() {
        FilterRegistrationBean<RequestWebFilter> bean = new FilterRegistrationBean<>();
        bean.setFilter(new RequestWebFilter());
        bean.setOrder(-1);
        bean.setUrlPatterns(Arrays.asList("/*"));
        return bean;
    }

}
